package com.xish.api.genre;


import com.xish.model.bean.WzmGenre;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jdbc.query.QueryDslJdbcTemplate;
import org.springframework.stereotype.Repository;

import static com.xish.model.table.QWzmGenre.wzmGenre;

@Repository
public class GenreRepository {

    @Autowired
    private QueryDslJdbcTemplate jdbcTemplate;

    public WzmGenre findById(int id) {
        return jdbcTemplate.queryForObject(
                jdbcTemplate.newSqlQuery().from(wzmGenre).where(wzmGenre.id.eq(id)), wzmGenre);
    }
}
